﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SearchGoogle.aspx.cs" Inherits="WCrawler.XP.SearchGoogle" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <script type="text/javascript" language="javascript">
    function changeCheckState() {
        try {
            var frm = document.forms[0];
            var i = 0;
            for (i = 0; i < frm.length; i++) {
                if (frm.elements[i].id.indexOf('chkCheckItem') != -1) {
                    if (document.getElementById(frm.elements[i].id) != null) {
                        if (frm.elements[i].checked == false) {
                            frm.elements[i].checked = true;
                        } else {
                            frm.elements[i].checked = false;
                        }
                    }
                }
            }
        } catch (err) { }
    }
    </script>
    <form id="form1" runat="server">
    <div>
        <asp:RadioButtonList ID="radioButtonListSearchEngines" runat="server">
            <asp:ListItem Selected="True" Value="1">Google</asp:ListItem>
            <asp:ListItem Value="2">Bing</asp:ListItem>
            <asp:ListItem Value="3">Yahoo</asp:ListItem>
        </asp:RadioButtonList>
        <asp:Label ID="Label1" runat="server" Text="Search string"></asp:Label>
        <asp:TextBox ID="txtSearchString" runat="server" Width="417px"></asp:TextBox>
        <asp:Button ID="btnSearch" runat="server" onclick="btnSearch_Click" 
            Text="Search" />
        <br />
        <asp:CheckBox ID="chkSearchPaging" runat="server" Text="Search Paging" />
        <br />
        <asp:Button ID="btnCheckInformation" runat="server" 
            onclick="btnCheckInformation_Click" Text="Check Information" />
        <asp:Button ID="btnAddSelectedForums" runat="server" 
            onclick="btnAddSelectedForums_Click" Text="Add Selected Forums" />
        <br />
        <asp:Label ID="Label2" runat="server" Text="Select View"></asp:Label>
        <asp:DropDownList ID="dropDownListView" runat="server" AutoPostBack="True" 
            onselectedindexchanged="dropDownListView_SelectedIndexChanged">
            <asp:ListItem Selected="True" Value="0"></asp:ListItem>
            <asp:ListItem Value="1">Available</asp:ListItem>
            <asp:ListItem Value="2">Not Available</asp:ListItem>
        </asp:DropDownList>
        <br />
    </div>
    <div>
        <asp:GridView ID="gridViewResult" runat="server" CellPadding="4" 
            ForeColor="#333333" GridLines="Both" AutoGenerateColumns="false" 
            onrowdatabound="gridViewResult_RowDataBound">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:TemplateField HeaderText="Select" ItemStyle-HorizontalAlign="Center">
                    <HeaderTemplate>
                    <asp:CheckBox ID="chkHead" runat="server"
                    onclick="changeCheckState(this);" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="chkCheckItem" Runat="server" />
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="No." ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Label ID="lblNum" Runat="server" />
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Url" SortExpression="Url">
                    <ItemTemplate>
                        <asp:HyperLink ID="hyperLinkUrl" runat="server" NavigateUrl='<%#Eval("Url") %>' Text='<%#Eval("Url") %>'></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Original Url" SortExpression="OriginalUrl">
                    <ItemTemplate>
                        <asp:HyperLink ID="hyperLinkOriginalUrl" runat="server" NavigateUrl='<%#Eval("OriginalUrl") %>' Text='<%#Eval("OriginalUrl") %>'></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Description" SortExpression="Description">
                    <ItemTemplate>
                        <%#Eval("Description") %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Type" SortExpression="Type">
                    <ItemTemplate>
                        <asp:Label ID="lblForumType" runat="server" Text='<%#Eval("Type")%>'></asp:Label>
                        <asp:Label ID="lblVersion" runat="server" Text='<%#Bind("Version")%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Location" SortExpression="Location">
                    <ItemTemplate>
                        <asp:Image ID="imgFlag" ImageUrl='<%#Eval("FlagUrl")%>'  runat="server"/>
                        <asp:Label ID="lblLocation" runat="server" Text='<%#Eval("Location")%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Rank" SortExpression="Rank">
                    <ItemTemplate>
                        <asp:Label ID="lblRank" runat="server" Text='<%#Eval("Rank")%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="IsExist" SortExpression="IsExist">
                    <ItemTemplate>
                        <asp:CheckBox ID="chkIsExist" runat="server" Checked='<%#Eval("IsExist")%>'></asp:CheckBox>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>

            <EditRowStyle BackColor="#7C6F57" />
            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#E3EAEB" />
            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F8FAFA" />
            <SortedAscendingHeaderStyle BackColor="#246B61" />
            <SortedDescendingCellStyle BackColor="#D4DFE1" />
            <SortedDescendingHeaderStyle BackColor="#15524A" />

        </asp:GridView>
    
    </div>
    </form>
</body>
</html>
